# Maintainer: Kyle Keen <keenerd@gmail.com>
# Maintainer: Xyne <ca dot archlinux at xyne, backwards>
# Contributor: nikor

pkgname=opencsg
pkgver=1.5.1
pkgrel=1
pkgdesc="Library for image-based CSG rendering using OpenGL."
url="http://www.opencsg.org"
arch=('loong64' 'x86_64')
license=('GPL2')
depends=('glew' 'glut' 'libgl')
source=("http://www.opencsg.org/OpenCSG-${pkgver}.tar.gz")
sha1sums=('fecc06e5840147dece269d6bfd8de3b4284abf02')

build() {
  cd "$srcdir/OpenCSG-$pkgver"
  sed -i 's|-rpath,../lib|-rpath,/usr/lib|' src/Makefile
  cd src
  make
}

package() {
  cd "$srcdir/OpenCSG-$pkgver"
  install -D lib/libopencsg.so.$pkgver "$pkgdir/usr/lib/libopencsg.so.$pkgver"
  install -D include/opencsg.h "$pkgdir/usr/include/opencsg.h"
  cd "$pkgdir/usr/lib/"
  ln -s libopencsg.so.$pkgver libopencsg.so.1.4
  ln -s libopencsg.so.$pkgver libopencsg.so.1
  ln -s libopencsg.so.$pkgver libopencsg.so
}

